package com.qmth.gkwb.web.view;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qmth.gkwb.data.document.Settings;
import com.qmth.gkwb.data.system.SettingService;

@Controller
@RequestMapping("view/settings")
public class SettingsController {

	@Autowired private SettingService settingService;
	
	@RequestMapping(method=RequestMethod.GET)
	@ResponseBody
	public Settings get(){
		return settingService.getSettings();
	}
	
	@RequestMapping(method=RequestMethod.POST)
	@ResponseBody
	public Settings save(@RequestBody Settings settings){
		return settingService.saveSettings(settings);
	}
}
